<%-- 
    Document   : index
    Created on : 23-mag-2011, 12.17.04
    Author     : liliana
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script type="text/javascript"  src="./bootstrap/js/jquery.min.js"></script>
<script type="text/javascript"  src="./bootstrap/js/bootstrap.js"></script>
<title>Esempio Ajax</title>


</head>
<body>

<script>
$(document).ready(function(){

  $("#citta").keyup(function(event){

		callAjax($("#citta"),'prov');
	    event.preventDefault();
	  });

  callStartAjax('','prov');
});

function callStartAjax(params, div){
	$.ajax({
			type: "POST",
			url: "Informazioni?actionType=start",
			data: params,
			success: function(msg){
				$("#" + div).html(msg);
			}
		});
}

function callAjax(params, div){
	$.ajax({
			type: "POST",
			url: "Informazioni?actionType="+params,
			data: params,
			success: function(msg){
				$("#" + div).html(msg);
			}
		});
}

</script>

	<div>
		<div >
			<label >Città: </label>
			<input type="text" id="citta" name="citta">

			<br>

			<label>Provincia: </label>
			<div id="prov">
			</div>
		</div>
	</div>

</body>
</html>
